//
//  BaseVC.m
//  YuDou
//
//  Created by qiupeng on 2018/6/24.
//  Copyright © 2018年 yingqi. All rights reserved.
//

#import "BaseVC.h"

@interface BaseVC ()

@property (nonatomic, strong) UIImageView *animImageView;

@end

@implementation BaseVC

- (UIImageView *)animImageView
{
    if (!_animImageView) {
        _animImageView = [[UIImageView alloc]init];
        _animImageView.frame = CGRectMake(0, 0, kScreenWidth * 0.6, kScreenHeight * 0.4);
        _animImageView.contentMode = UIViewContentModeScaleAspectFit;
        _animImageView.image = [UIImage imageNamed:@"img_loading_1"];
        _animImageView.center = self.view.center;
        _animImageView.animationImages = @[[UIImage imageNamed:@"img_loading_1"],[UIImage imageNamed:@"img_loading_2"]];
        _animImageView.animationDuration = 0.5;
        _animImageView.animationRepeatCount = LONG_MAX;
        _animImageView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin |UIViewAutoresizingFlexibleBottomMargin;
    }
    return _animImageView;

}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
}

- (void)setupUI
{
    [self.view addSubview:self.animImageView];
    [self.animImageView startAnimating];
    self.view.backgroundColor = kColor(250, 250, 250);
}

- (void)loadDataFinished
{
    [self.animImageView stopAnimating];
    self.animImageView.hidden = YES;
}
 
@end
